package com.umakr.ax.app.web;

import java.util.Map;

import com.umakr.ax.app.service.RadioStationShowWebService;
import com.umakr.ax.common.service.RadioStationShowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import com.umakr.ax.common.model.RadioStationShow;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import com.umakr.ax.core.base.AbstractController;

/**
 * <p>
 * ${table.comment}  前端控制器
 * </p>
 *
 * @author Umakr-Code-Generator
 * @since 2017-12-30
 */
@Controller
@RequestMapping("/api/web/radioStationShow")
public class RadioStationShowWebController extends AbstractController {

	@Autowired
	RadioStationShowWebService radioStationShowWebService;

	/**
	 * 发布电台秀
	 * @param modelMap
	 * @return
	 */
	@ApiOperation(value = "发布电台秀" )
	@PostMapping("/saveRadioStationShow")
	@ResponseBody
	public Object saveRadioStationShow(ModelMap modelMap, RadioStationShow show ) {
		return setSuccessModelMap(modelMap,radioStationShowWebService.saveRadioStationShow(show));
	}

	/**
	 * 软删除电台秀
	 * @param modelMap
	 * @return
	 */
	@ApiOperation(value = "删除电台秀")
	@GetMapping("/delRadioStationShow")
	public Object delRadioStationShow(ModelMap modelMap, Long showId ) {
		return setSuccessModelMap(modelMap,radioStationShowWebService.delRadioStationShow(showId));
	}

	/**
	 * 读取 自己电台发布的信息 分页展示
	 * @param modelMap
	 * @return
	 */
	@ApiOperation(value = "主播秀列表")
	@GetMapping("/listRadioStationShow")
	public Object listRadioStationShow(ModelMap modelMap, Long rsId ) {
		return setSuccessModelMap(modelMap,radioStationShowWebService.listRadioStationShow(rsId));
	}
}